/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

/**
 *
 * @author pais
 */
public class Address extends AnyObject {

    private String Street,City,State,Country,ZipCode;

    @Override
    public String toString() {
 //Solicitar Explicacion de la funcion APPEND en este lugar
        return new StringBuilder()
                .append("Country: ").append(this.Country)
                .append("Street: ").append( this.Street)
                .append("State: ").append( this.State)
                .append("ZipCode: ").append( this.ZipCode)
                .append("City: ").append( this.City).toString();
    }

    @Override
    public boolean equals(Object obj) {
   //PORQUE HACIAMOS ESTA PREGUNTA??????
        if (this==obj) return true;
   //PORQUE HACIAMOS ESTA PREGUNTA??????
        if (!(obj instanceof Address)) return false;
   //CAST????
        final Address address = (Address) obj;
   //EXPRESION INCOMPRENSIBLE
        return this.hashCode() == address.hashCode();
    }

    @Override
    public int hashCode() {
        int result;
        result = (Street != null ? Street.hashCode() : 0);
        result = 42 * result + (City != null ? City.hashCode() : 0);
        result = 42 * result + (State != null ? State.hashCode() : 0);
        result = 42 * result + (Country != null ? Country.hashCode() : 0);
        result = 42 * result + (ZipCode != null ? ZipCode.hashCode() : 0);
        return result;
    }

    public String getCity() {
        return City;
    }

    public void setCity(String City) {
        this.City = City;
    }

    public String getCountry() {
        return Country;
    }

    public void setCountry(String Country) {
        this.Country = Country;
    }

    public String getState() {
        return State;
    }

    public void setState(String State) {
        this.State = State;
    }

    public String getStreet() {
        return Street;
    }

    public void setStreet(String Street) {
        this.Street = Street;
    }

    public String getZipCode() {
        return ZipCode;
    }

    public void setZipCode(String ZipCode) {
        this.ZipCode = ZipCode;
    }

}
